<div id="upload_pic">
	<% form_for(:photo, :url => {:action=>'editpic'}, :html => { :multipart => true, :class => "form_pic" }) do |f| -%>
		
		<p>编辑您的图片</p>
		<%= text_field_for f, :title, @photo, { :text=>"标题", :required => true } %>
		<%= text_area_for f, :description, @photo, { :text=>"产品描述", :cols =>30, :rows => 5 } %>
		<p>原图</p>
		<%=image_tag(@photo.pic.url)%>
		<p>上传将覆盖原来的图片</p>
		<div class="form_text"><label class="label" for="pic">上传图片</label><span class="required_mark">*</span></div>
		<%= f.file_field :pic%>
		<%= error_message_on @photo, :pic_file_name -%>
		<%= error_message_on @photo, :pic_file_size -%>
		<%= error_message_on @photo, :pic_content_type%>
		<%=hidden_field_tag 'id', @photo.id%>
		<div class="submit">
			<%= submit_tag '修改' -%>	
		</div>
	     
	<% end -%>
</div>